// 04jyhs/bizAdmin/bizManage/bizManage.js
var co = require("../../../resource/js/common.js")
var _this, _data
var _pageNum = 1
Page({
   data: {
      bizList: [],//商家列表
      //是否隐藏显示底部提示
      hint: true,
      //frame高度
      frame_h: 1800
   },
   onLoad: function (options) {
      _this = this
      _data = _this.data
      _this.setData({
         frame_h: wx.getSystemInfoSync().windowHeight + 10
      })
   },
   onUnload: function () {
      _pageNum = 1
   },
   onReachBottom: function () {
      _this.getBizList()
   },
   onShow: function () {
      _pageNum = 1
      _data.bizList = []
      _this.getBizList()
   },
   //获取旧约回收端商家列表
   getBizList() {
      wx.showLoading({
         title: '正在加载数据中...',
      })
      co.getShareApi("jyhs/Admin/getBizList", {
         page: _pageNum
      }, function (res) {
         wx.hideLoading()
         if (res.code == 0) {
            var list = _data.bizList.concat(res.data)
            _this.setData({
               bizList: list
            })
            _pageNum++
         } else {
            _this.setData({
               hint: false
            })
            co.toastAllText(res.msg)
         }
      })
   },
   //指派事件
   pointsend(e) {
      var BizID = e.currentTarget.dataset.biz
      wx.navigateTo({
         url: '../pointSend/pointSend?Biz_ID=' + BizID,
      })
   }
})